package com.nulldev.util.web.HttpServer3.extensions.botAway;

import com.nulldev.util.VariableAPI.ArrayUtils;

public class BotAway {

	private static final String[] COMMON_BOT_REQUEST =
		{ "/manager/html", "http://ifconfig.me/", "/http://ifconfig.me/", "/manager/text/list", "/w00tw00t.at.ISC.SANS.DFind:)",
				"/nice%20ports%2C/Tri%6Eity.txt%2ebak", "/securityRealm/user/admin/search/index", "/mifs/.;/services/LogService", "/script", "/board.cgi",
				"/HNAP1/", "/actuator/gateway/routes", "/actuator/health", "/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh", "/_ignition/execute-solution",
				"/Autodiscover/Autodiscover.xml", "/console/", "/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php", "/ab2g", "/ab2h", "/hudson", "/board.cgi",
				"/GponForm/diag_Form", "/service.cgi", "/FD873AC4-CF86-4FED-84EC-4BD59C6F17A7", "/Telerik.Web.UI.WebResource.axd", "/cgi-bin/ViewLog.asp",
				"/system_api.php", "/tmUnblock.cgi", "/boaform/admin/formLogin", "/phpmyadmin/index.php", "/.env", "/redfish/v1", "/setup.cgi", "/cgi-bin/luci",
				"/invoker/readonly", "/geoserver", "/cgi-bin/authLogin.cgi", "/functionRouter", "/config/getuser", "/UnityPlayer.dll", "/ttd.exe", "/.git/HEAD",
				"/Portal0000.htm", "/Portal/Portal.mwsl", "/rest/applinks/1.0/manifest", "/nvidia_license_upd.php",
				"/wp-content/themes/twentytwentyone/inc/block-css.php", "/confluence/rest/applinks/1.0/manifest" };

	public static boolean isBot(final String request) {
		if (request == null || request.length() <= 1)
			return false;
		return ArrayUtils.StringArrayUtils.containsInString(COMMON_BOT_REQUEST, request);
	}
}
